package cn.kgc.util;

import java.util.List;

/**
 * @描述
 * @author：LY
 * @2018/11/1 18:45
 */
public class Page<T> {

    private int totalCount;//总记录数
    private int totalPage;//总页面数
    private final int pageSize = 4;//页面显示的数量


    private int pageNum;//页面标识
    private List<T> list;//页面数据

    private int startIndex;//开始位置
    private T tiaojian;//查询条件

    public Page(int totalCount,int pageNum){
        this.totalCount = totalCount;
        this.totalPage = totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
        this.pageNum = pageNum;
        this.startIndex = (this.pageNum-1)*pageSize;
    }


    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public T getTiaojian() {
        return tiaojian;
    }

    public void setTiaojian(T tiaojian) {
        this.tiaojian = tiaojian;
    }
}
